home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / MacGnuGo 0.5e / gnugo.src / checkatari.c next >
Encoding:
C/C++ Source or Header  |  1993-10-22  |  524 b   |  20 lines  |  [TEXT/R*ch]

  1. #include "comment.header"
  2.  
  3. #define EMPTY 0
  4.  
  5. extern unsigned char p[19][19], l[19][19];
  6. extern int currentStone, opposingStone, MAXX, MAXY;
  7. extern int atari;
  8.  
  9. int checkatari(int i, int j)
  10. {
  11.     if (i > 0 && p[i-1][j] == opposingStone && l[i-1][j] == 2) atari = 1;
  12.     if (i < MAXX-1 && p[i+1][j] == opposingStone && l[i+1][j] == 2) atari = 1;
  13.     if (j > 0 && p[i][j-1] == opposingStone && l[i][j-1] == 2) atari = 1;
  14.     if (j < MAXY-1&& p[i][j+1] == opposingStone && l[i][j+1] == 2) atari = 1;
  15.     return (atari);
  16. }
  17.  
  18. /* */
  19.  
  20.